home *** CD-ROM | disk | FTP | other *** search
- property pBGSoundStatus, pButtonStatus, pBGSoundMember, pBGSoundLooped, pBGSoundChannel, pButtonSoundMember, pButtonSoundChannel, pVolume, pRealVolume
- global gSound, gVideo
-
- on new me
- pBGSoundStatus = "false"
- pButtonStatus = "false"
- pBGSoundMember = EMPTY
- pBGSoundLooped = EMPTY
- pButtonSoundMember = EMPTY
- pBGSoundChannel = 0
- pButtonSoundChannel = 0
- pVolume = 100
- pRealVolume = 0
- return me
- end
-
- on mStopSound me
- sound(pBGSoundChannel).stop()
- gSound.pBGSoundStatus = "FALSE"
- pRealVolume = 0
- end
-
- on mStopSoundTrailer me
- sound(pBGSoundChannel).stop()
- pRealVolume = 0
- end
-
- on mStopSoundButton me
- sound(pButtonSoundChannel).stop()
- end
-
- on mSetVolume me, vString
- case vString of
- "volume25":
- pVolume = 25
- sound(pBGSoundChannel).volume = 255 * 0.25
- pRealVolume = 255 * 0.25
- "volume50":
- pVolume = 50
- sound(pBGSoundChannel).volume = 255 * 0.5
- pRealVolume = 255 * 0.5
- "volume75":
- pVolume = 75
- sound(pBGSoundChannel).volume = 255 * 0.75
- pRealVolume = 255 * 0.75
- "volume100":
- pVolume = 100
- sound(pBGSoundChannel).volume = 255
- pRealVolume = 255
- end case
- end
-
- on mPlaySound me
- gSound.pBGSoundStatus = "TRUE"
- if sound(pBGSoundChannel).isBusy() then
- exit
- end if
- puppetSound(pBGSoundChannel, member(pBGSoundMember))
- case gSound.pVolume of
- 0:
- sound(pBGSoundChannel).volume = 0
- gVideo.pVideoVolume = 0
- pRealVolume = 0
- 25:
- sound(pBGSoundChannel).volume = 255 * 0.25
- gVideo.pVideoVolume = 255 * 0.25
- pRealVolume = 255 * 0.25
- 50:
- sound(pBGSoundChannel).volume = 255 * 0.5
- gVideo.pVideoVolume = 255 * 0.5
- pRealVolume = 255 * 0.5
- 75:
- sound(pBGSoundChannel).volume = 255 * 0.75
- gVideo.pVideoVolume = 255 * 0.75
- pRealVolume = 255 * 0.75
- 100:
- sound(pBGSoundChannel).volume = 255
- gVideo.pVideoVolume = 255
- pRealVolume = 255
- end case
- end
-
- on mResumeSound me
- if pBGSoundStatus = "false" then
- gSound.mStopSound()
- exit
- end if
- if sound(pBGSoundChannel).isBusy() then
- exit
- end if
- if gSound.pRealVolume <> gVideo.pVideoVolume then
- sound(pBGSoundChannel).volume = gVideo.pVideoVolume
- end if
- puppetSound(pBGSoundChannel, member(pBGSoundMember))
- end
-
- on mPlayButtonClick me
- if pButtonStatus = "false" then
- gSound.mStopSoundButton()
- exit
- end if
- if sound(pButtonSoundChannel).isBusy() then
- exit
- end if
- if gSound.pRealVolume <> gVideo.pVideoVolume then
- sound(pButtonSoundChannel).volume = gVideo.pVideoVolume
- end if
- puppetSound(pButtonSoundChannel, member(pButtonSoundMember))
- end
-